package com.ugoodtech.mdcc.web.controller;

/* Copyright (C) Ugoodtech, Inc - All Rights Reserved.
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 * Proprietary and confidential.
 * Written by Stone Shaw.
 */

import com.ugoodtech.mdcc.core.LogConstants;
import com.ugoodtech.mdcc.web.dto.JsonResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/settings")
public class SettingController {

    @Value("${service.type}")
    private String serviceType;
    @Value("${service.version}")
    private String serviceVersion;


    @RequestMapping(value = "/getSystemVersion", method = RequestMethod.GET)
    public JsonResponse deleteBrokenNeedleType(
//            Principal principal
    ) {
        Map<String, String> map = new HashMap();
        map.put("serviceVersion", serviceVersion);
        map.put("serviceType", serviceType);
        return JsonResponse.successResponseWithData(map);
    }


    @RequestMapping(value = "/getBusinesses", method = RequestMethod.GET)
    public JsonResponse getBusinesses(
//            Principal principal
    ) {
        List<String> data=new ArrayList<>();
        data.add(LogConstants.business_type_login);
        data.add(LogConstants.operate_type_confirm_action);
        data.add(LogConstants.operate_type_send_export);
        data.add(LogConstants.operate_type_send_import);
        data.add(LogConstants.business_type_customer);
        data.add(LogConstants.business_type_regular_report);
        data.add(LogConstants.business_type_lean_paint_report);
        data.add(LogConstants.business_type_customer_report);
        data.add(LogConstants.business_type_department);
        data.add(LogConstants.business_type_system_user);
        data.add(LogConstants.operate_type_add_department_user);
        data.add(LogConstants.business_type_people);
        return JsonResponse.successResponseWithData(data);
    }

    @RequestMapping(value = "/getOperates", method = RequestMethod.GET)
    public JsonResponse getOperates(
//            Principal principal
    ) {
        List<String> data = new ArrayList<>();
        data.add(LogConstants.business_type_login_success);
        data.add(LogConstants.business_type_login_fail);
        data.add(LogConstants.operate_type_confirm);
        data.add(LogConstants.operate_type_not_confirm);
        data.add(LogConstants.operate_type_send_export+LogConstants.business_type_audit_report);
        data.add(LogConstants.operate_type_send_export+LogConstants.business_type_regular_report_statistics);
        data.add(LogConstants.operate_type_send_export+LogConstants.business_type_customer_report_statistics);
        data.add(LogConstants.operate_type_send_export+LogConstants.business_type_lean_paint_report_statistics);
        data.add(LogConstants.operate_type_send_export+LogConstants.business_type_regular_report_statistics2);
        data.add(LogConstants.operate_type_send_export+LogConstants.business_type_regular_report);
        data.add(LogConstants.operate_type_send_export+LogConstants.business_type_system_user_detail);
        data.add(LogConstants.operate_type_add);
        data.add(LogConstants.operate_type_set_receive_report);
        data.add(LogConstants.operate_type_supplement);
        data.add(LogConstants.operate_type_edit+"/"+LogConstants.operate_type_manage_report);
        data.add(LogConstants.operate_type_withdraw);
        data.add(LogConstants.operate_type_confirm_edit);
        data.add(LogConstants.operate_type_freeze);
        data.add(LogConstants.operate_type_enable);
        data.add(LogConstants.operate_type_delete);
        data.add(LogConstants.operate_type_send_sms);

        return JsonResponse.successResponseWithData(data);
    }


//    @RequestMapping(value = "/getOperates", method = RequestMethod.GET)
//    public JsonResponse getOperates(
////            Principal principal
//    ) {
//        List<String> data=new ArrayList<>();
//        data.add(LogConstants.operate_type_add);
//        data.add(LogConstants.operate_type_send_sms);
//        data.add(LogConstants.operate_type_send_export);
//        data.add(LogConstants.operate_type_supplement);
//        data.add(LogConstants.operate_type_edit);
//        data.add(LogConstants.operate_type_plan_submit);
//        data.add(LogConstants.operate_type_confirm_edit);
//        data.add(LogConstants.operate_type_delete);
//        data.add(LogConstants.operate_type_add_department_user);
//        data.add(LogConstants.operate_type_freeze);
//        data.add(LogConstants.operate_type_enable);
//        data.add(LogConstants.operate_type_withdraw);
//        data.add(LogConstants.operate_type_confirm);
//        data.add(LogConstants.operate_type_not_confirm);
//        return JsonResponse.successResponseWithData(data);
//    }
//
//
//    @RequestMapping(value = "/getBusinesses", method = RequestMethod.GET)
//    public JsonResponse getBusinesses(
////            Principal principal
//    ) {
//        List<String> data=new ArrayList<>();
//        data.add(LogConstants.business_type_customer);
//        data.add(LogConstants.business_type_regular_report_plan);
//        data.add(LogConstants.business_type_regular_report);
//        data.add(LogConstants.business_type_regular_report_edit);
//        data.add(LogConstants.business_type_regular_report_statistics);
//        data.add(LogConstants.business_type_regular_report_statistics2);
//        data.add(LogConstants.business_type_department);
//        data.add(LogConstants.business_type_lean_paint_report);
//        data.add(LogConstants.business_type_lean_paint_report_statistics);
//        data.add(LogConstants.business_type_people);
//        data.add(LogConstants.business_type_system_user);
//        data.add(LogConstants.business_type_system_user_detail);
//        data.add(LogConstants.business_type_customer_report);
//        data.add(LogConstants.business_type_customer_report_statistics);
//        data.add(LogConstants.business_type_login);
//
//        return JsonResponse.successResponseWithData(data);
//    }
}
